package com.highspeed.bdk.gateway.socket.analyze.message.preset_deploy.resolver;

import com.highspeed.bdk.gateway.Util;
import com.highspeed.bdk.gateway.socket.analyze.message.preset_deploy.base.MessageResolver;

import java.util.Map;

/**
 * RIO链路APP信息调显结果,FUNC
 */
public class RioLinkAppDisplayFuncResolver extends MessageResolver {

    @Override
    protected Map doResolveBody(byte[] response) {
        FunLinkInfoResolver funLinkInfoResolver = new FunLinkInfoResolver();
        funLinkInfoResolver.setContainer(getContainer());
        int i = 1;
        int end;
        while (true) {
            if ((end = Util.getInt(response, getOffset())) == 0xAAAAAAAA) {
                break;
            }
            System.out.println("結束......" + end + "..........offset...." + getOffset());
            logger.info("解析第" + i + "个组件。。。");
            i++;
            funLinkInfoResolver.doResolveBody(response);
        }
        return funLinkInfoResolver.getContainer();
    }
}
